<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>联系我们</title>
		<link rel="stylesheet" type="text/css" href="static/project/css/style.css"/>
		<link rel="stylesheet" type="text/css" href="static/project/css/contact.css"/>
		<script type="text/javascript" src="static/project/js/jquery-1.8.0.min.js"></script>
		<script type="text/javascript" src="http://api.map.baidu.com/api?key=&v=1.1&services=true"></script>
		<script type="text/javascript" src="static/project/js/index.js"></script>
		
	</head>
	<body>
				<!--页头部分-->
<?php include('app/index/public/html/_header.html');?>
		<!--banner图-->
		<div class="banners">
				<img src="<?php echo $banner['file'];?>"/>
		</div>
		<!--头部联系方式-->
		<div class="min">
			<div class="container">
				<div class="title">
					<ul>
						<li class="current"><a href="#">联系方式</a></li>
					</ul>
				</div>
				<!--loction部分-->
				<div class="loction"><a href="index.php?a=index&b=index&c=index">首页></a><a href="#">联系我们></a><a href="#">联系方式</a></div>
			</div>
		</div>
		<!--联系方式联系地址板块-->
		<div class="contact">
			<div class="content">
				<div class="left">
					<span><img src="static/project/img/con1.png"/>公司名称：<?php echo $contact['name'];?></span>
					<p><img src="static/project/img/con2.png"/>电话：<?php echo $contact['tel'];?></p>
					<p><img src="static/project/img/con3.png"/>传真：<?php echo $contact['sent'];?></p>
				</div>
				<div class="right">
					<p><img src="static/project/img/con4.png"/>邮箱：<?php echo $contact['email'];?></p>
					<p><img src="static/project/img/con5.png"/>邮编：<?php echo $contact['post'];?></p>
					<p><img src="static/project/img/con6.png"/>地址：<?php echo $contact['address'];?></p>
				</div>
			</div>
		</div>
		<!--地图板块-->
		<div id="dituContent"></div>
		<!--底部输入信息板块-->
		<div class="bottom">
			<div class="container">
				<form action="index.php?a=index&b=contact&c=contact" method="post">
					<div class="left">
						<input name="name" id="name" type="text" placeholder="姓名：" class="first" />
						<input name="tel" id="tel" type="text" placeholder="电话：" />
						<input name="email" id="email" type="email" placeholder="邮箱：" />
					</div>
					<div class="right">
						<textarea name="requirement" id="requirement" placeholder="您提出的要求"></textarea>
						<input id="vali" name="vali" type="text" placeholder="请输入验证码"  class="captcha"/>
						<img id="validate" name="validate" src="index.php?a=admin&b=login&c=validate"/></a>
						<input type="submit" value="提交" name="sub" id="sub" class="sub"/>
					</div>
				</form>
			</div>
		</div>
		
		<script src="static/project/js/jquery-1.8.0.min.js"></script>
		<script>
			
			//电话格式判断
		    $('#tel').blur(function(){
		    	var tel = $(this).val();
				if(tel == '')
				{
					alert('电话不能为空！');
					return false;
				}else
				{
					var reg = /^\d{7,11}$/;
					var tel_result = reg.exec(tel);
					if(tel_result == null)
					{
						alert('电话号码格式有误,请重新输入！');
						return false;
					}
					return false;
				}
			})

			$(document).ready(function(c) {
				
				$('#validate').click(function() {
					freshvalidate();
				})

				function freshvalidate() {
					var src = $('#validate').attr('src');
					src = src + '&';
					$('#validate').attr('src', src);
				}
				$('#sub').click(function() {
					
					var name = $('input[name=name]').val();
					var tel = $('input[name=tel]').val();
					var email = $('input[name=email]').val();
					var requirement = $('textarea[name=requirement]').val();
					var vali = $('input[name=vali]').val();
					$.post('index.php?a=index&b=contact&c=contact', {
						'name': name,
						'tel': tel,
						'email': email,
						'requirement': requirement,
						'vali': vali,
					}, function(date) {
						if(date == 20000) {
							alert('验证码错误');
							freshvalidate();
							return false;
						}else if(date == 20002) {
							alert('提交成功');
							window.location = 'index.php?a=index&b=contact&c=contact';
							return false;
						}else if(date == 20003)
						{
							alert('提交失败');
							window.location = 'index.php?a=index&b=contact&c=contact';
							return false;
						}
					})
					return false;
				})

			})
			
			
		</script>
<!--底部-->
<?php include('app/index/public/html/_footer.html');?>
